home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / 1994.12.gz / 1994.12 / 000108_mackay@cs.washington.edu_Wed Dec 28 04:10:39 1994.msg < prev    next >
Internet Message Format  |  1994-12-30  |  6KB

  1. Received: from june.cs.washington.edu by cs.umb.edu with SMTP id AA24074
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Wed, 28 Dec 1994 15:10:42 -0500
  3. Return-Path: <mackay>
  4. Received: (mackay@localhost) by june.cs.washington.edu (8.6.9/7.2ju) id MAA02402; Wed, 28 Dec 1994 12:10:39 -0800
  5. Date: Wed, 28 Dec 1994 12:10:39 -0800
  6. From: mackay@cs.washington.edu (Pierre MacKay)
  7. Message-Id: <199412282010.MAA02402@june.cs.washington.edu>
  8. To: tex-k@cs.umb.edu, mackay@cs.washington.edu
  9. Subject: A little test driver for kpathsea
  10.  
  11.  
  12. /*
  13.  * I've found this little driver for Karl Berry's kpathsea 
  14.  * library pretty useful.  It gives a feeling of exactly what
  15.  * delays are involved in the use of the kpathsea search stratagem
  16.  *       (they are a lot less than you think they are)
  17.  * and makes debugging an environment a lot easier.  The only
  18.  * trick you have to remember is that pk fonts (and any similar
  19.  * files with mode specifications) need to be called with the
  20.  * mode directory.  "cmr10.300pk" will be reported as null, but
  21.  * "cx/cmr10.300pk" will find the file.  (This is explained in
  22.  * the standard texmf.cnf file.)
  23.  *
  24.  * Typical usage:    kpsewhich PKFONTS
  25.  * then respond to the "Filename:" prompt
  26.  * Exit with "q" or "quit"
  27.  *
  28.  * cc -c -I<kpsepath> -I<kpsepath>/kpathsea kpsewhich.c
  29.  * cc -o kpsewhich kpsewhich.o <kpsepath>/kpathsea/kpathsea.a
  30.  *
  31.  * <kpsepath> is a path to wherever the kpathsea source directory
  32.  * is---it is assumed that kpathsea.a has already been made
  33.  *
  34.  * Pierre Mackay Wed Dec 28 12:01:59 PST 1994 mackay@cs.washington.edu
  35.  */
  36.  
  37. #include <stdio.h>
  38. #include <sys/param.h>
  39.  
  40. #include <kpathsea/config.h>
  41. #include <kpathsea/tex-file.h>
  42. #include <kpathsea/tex-make.h>
  43.  
  44. main(argc, argv)
  45. int argc;
  46. char* argv[];
  47. {
  48.       char buf[100];
  49.       char *path;
  50.       kpse_file_format_type kpsewhich_type;
  51.       kpsewhich_type = kpse_tex_format;
  52.       if (argc > 1) {
  53.     if ((strcmp(argv[1], "?") == 0) || (strcmp(argv[1], "help")) == 0) {
  54.       printf
  55.         ( "Usage: kpsewhich <format_type>  where format_type = one of\n");
  56.       printf
  57.         ( "PKFONTS GFFONTS GLYPHFONTS\n");
  58.       printf
  59.         ( "TEXINPUTS MFINPUTS TEXFORMATS MFBASES\n");
  60.       printf
  61.         ( "TEXPOOL MFPOOL TFMFONTS VFFONTS\n");
  62.       printf
  63.         ( "BIBINPUTS BSTINPUTS TEXCONFIG DVIPSHEADERS\n");
  64.       printf
  65.         ( "TEXMF_CNF and pseudo environments LATEX LATEX209\n");
  66.       exit(0);
  67.     }
  68.     if (strcmp(argv[1], "PKFONTS") == 0) {
  69.       kpsewhich_type = kpse_pk_format;
  70.     kpse_set_progname("dvips");
  71.     }
  72.     if (strcmp(argv[1], "GFFONTS") == 0) {
  73.       kpsewhich_type = kpse_gf_format;
  74.     kpse_set_progname("dvips");
  75.     }
  76.     if (strcmp(argv[1], "GLYPHFONTS") == 0) {
  77.       kpsewhich_type = kpse_any_glyph_format;
  78.     kpse_set_progname("dvips");
  79.     }
  80.     if (strcmp(argv[1], "TEXINPUTS") == 0) {
  81.       kpsewhich_type = kpse_tex_format;
  82.     kpse_set_progname("tex");
  83.     }
  84.     if (strcmp(argv[1], "MFINPUTS") == 0) {
  85.       kpsewhich_type = kpse_mf_format;
  86.     kpse_set_progname("mf");
  87.     } 
  88.     if (strcmp(argv[1], "TEXFORMATS") == 0) {
  89.       kpsewhich_type = kpse_fmt_format;
  90.     kpse_set_progname("initex");
  91.     }
  92.     if (strcmp(argv[1], "MFBASES") == 0) {
  93.       kpsewhich_type = kpse_base_format;
  94.     kpse_set_progname("inimf");
  95.     } 
  96.     if (strcmp(argv[1], "TEXPOOL") == 0) {
  97.       kpsewhich_type = kpse_texpool_format;
  98.     kpse_set_progname("initex");
  99.     }
  100.     if (strcmp(argv[1], "MFPOOL") == 0) {
  101.       kpsewhich_type = kpse_mfpool_format;
  102.     kpse_set_progname("inimf");
  103.     } 
  104.     if (strcmp(argv[1], "VFFONTS") == 0) {
  105.       kpsewhich_type = kpse_vf_format;
  106.     kpse_set_progname("dvips");
  107.     }
  108.     if (strcmp(argv[1], "TFMFONTS") == 0) {
  109.       kpsewhich_type = kpse_tfm_format;
  110.     kpse_set_progname("tex");
  111.     } 
  112.     if (strcmp(argv[1], "BIBINPUTS") == 0) {
  113.       kpsewhich_type = kpse_bib_format;
  114.     kpse_set_progname("bibtex");
  115.     } 
  116.     if (strcmp(argv[1], "BSTINPUTS") == 0) {
  117.       kpsewhich_type = kpse_bst_format;
  118.     kpse_set_progname("bibtex");
  119.     } 
  120.     if (strcmp(argv[1], "TEXCONFIG") == 0) {
  121.       kpsewhich_type = kpse_dvips_config_format;
  122.     kpse_set_progname("dvips");
  123.     }
  124.     if (strcmp(argv[1], "DVIPSHEADERS") == 0) {
  125.       kpsewhich_type = kpse_dvips_header_format;
  126.     kpse_set_progname("dvips");
  127.     }
  128.     if (strcmp(argv[1], "TEXMF_CNF") == 0) {
  129.       kpsewhich_type = kpse_cnf_format;
  130.     kpse_set_progname("tex");
  131.     }
  132.     if (strcmp(argv[1], "LATEX") == 0) {
  133.       kpsewhich_type = kpse_tex_format;
  134.     kpse_set_progname("latex");
  135.     }
  136.     if (strcmp(argv[1], "LATEX209") == 0) {
  137.       kpsewhich_type = kpse_tex_format;
  138.     kpse_set_progname("latex209");
  139.     }
  140.       } else {
  141.     kpse_set_progname("tex");
  142.     printf("Using default TEXINPUTS setting.\n");
  143.       }
  144.       kpse_init_format(kpsewhich_type);
  145.       if (argc < 3) {
  146.     /* might want to put search targets on command line */
  147.     printf("Filename: ");
  148.     while (gets(buf) != NULL) {
  149.       if (( strcmp(buf,"q") == 0 ) || (strcmp(buf,"quit") == 0 )) exit(0);
  150.       path = kpse_find_file(buf,kpsewhich_type,0);
  151.       printf("%s -> %s\n", buf, path);
  152.       printf("Filename: ");
  153.     }
  154.       }
  155.       exit(0);
  156. }
  157.  
  158. %=======================================================================%
  159. |                             N O T I C E                               |
  160. |  The University of Washington has ordered us to close the Northwest   |
  161. |  Computing Support Center, and to terminate the official support      |
  162. |  of UnixTeX.  Although the termination was final as of June 14, 1994  |
  163. |  I will continue unofficially to provide tape distributions and       |
  164. |  any other services I can. Although I cannot be near my phone on any  |
  165. |  regular schedule, I now have an answering machine.  Please note      |
  166. |  the changes in address and telephone number.  There is no Northwest  |
  167. |  Computing Support Center any longer.                                 |
  168. |                                                                       |
  169. %=======================================================================%
  170. Email concerned with UnixTeX distribution software may be sent 
  171. To:     mackay@cs.washington.edu        Pierre A. MacKay
  172. Smail:  Department of Classics            Emeritus Druid for
  173.     Denny Hall, Mail Stop DH-10        Unix-flavored TeX
  174.     University of Washington
  175.     Seattle, WA 98195
  176.     (206) 543-2268 (Message recorder now available)
  177.                                                 *********************
  178. Montlake Community College            *Per ardua ad infima*
  179. (formerly the University of Washington)        *Per infima in fimum*
  180.                                                 *********************